package com.xuedakun.xasdk;

import android.content.Context;
import android.os.Process;
import android.support.multidex.MultiDexApplication;

/**
 * Created by xuedakun on 2017/6/3 14:07
 * 自定义application，继承MultiDexApplication，解决64k方法数量限制的问题
 *
 * @version : v1.0
 * @project : xasdk
 * @Email : dakun611@Gmail.com
 */

public class XApplication extends MultiDexApplication {

    private static final String LOG_TAG = "XApplication";

    private static Context context;

    @Override
    public void onCreate() {
        super.onCreate();

        context = getApplicationContext();
    }

    /**
     * 获取全局上下文对象
     *
     * @return
     */
    public static Context getContext() {
        return context;
    }

    /**
     * 退出应用
     */
    public static void exit() {
        Process.killProcess(Process.myPid());
    }
}
